<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.prime.com.tr/ui" contentType="text/html">

<html>
	
	<h:head> 
		<title> Rede de Imóveis </title>	
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<h:outputScript library="jquery" name="jquery-1.2.6.js" />
		<h:outputScript library="jquery/imob" name="super.js" />
		<h:outputStylesheet library="css" name="myform.css" />
	</h:head>

<h:body>

<c:if test="#{mailSenderBO.valid == true }">
	<div class="error"><span class="error">${msgs}</span></div>
</c:if>

<c:if test="#{mailSenderBO.valid != true }">
	<h2>Fale Conosco</h2>
	<hr />
	<center>
	<h:form id="myforms" prependId="false" >
		<div id="form" class="contato">
			<p>
				<h:outputLabel for="nome" value="Nome:" />
				<span id="errorContato"><span class="error">${msgs}</span> </span>
				<rich:message for="nome" />
				<h:inputText id="nome" required="true"
							requiredMessage="Favor informa seu Nome"
							styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all" 
							value="#{mailSenderBO.nome}" />
				
			</p>
			
			<p>
				<h:outputLabel for="email" value="E-mail:" />
				<rich:message for="email" />
				<h:inputText id="email" title="E-mail" required="true"
							requiredMessage="Favor informa seu E-mail" 
							styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all"
							value="#{mailSenderBO.mail}" />
			</p>
				
			<p>
				<h:outputLabel for="assunto" value="Assunto:" />
				<rich:message for="assunto" />
				<h:inputText id="assunto" required="true"
							requiredMessage="Favor informa o Assunto"
							styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all"
							value="#{mailSenderBO.assunto}" />
			</p>
			
			<p>
				<h:outputLabel id="lblMensagem" for="mensagem" value="Mensagem:" />
				<span>
					<h:outputLabel id="lblCheck" for="checked" value="Receber uma cópia" />
					<h:selectBooleanCheckbox id="checked"
							styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all" 
							value="#{mailSenderBO.checked}" />
				</span>
				
				<rich:message for="mensagem" id="errorTxtArea" />
				<h:inputTextarea id="mensagem" required="true" rows="4" 
							requiredMessage="Favor informar o texto a ser enviado."
							styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all"
							value="#{mailSenderBO.mensagem}" />
			</p>
		</div>
		<div id="contatoButton" class="button">
			<h:commandButton id="btnReset" value="Limpar" type="reset" />
			<h:commandButton id="btnCancel" value="Cancelar" type="button" />
			<h:commandButton value="Cadastrar" actionListener="#{mailSenderBO.enviarMail}"/>
		</div>
		
	</h:form>
	</center>
</c:if>
</h:body>
</html>

</f:view>